![]() |
PATH![]() |
The USBGetDriverConnectionID function returns a pointer to the connection ID, CFragConnectionID , of the driver referenced by the device or interface reference.
OSStatus USBGetDriverConnectionID (
USBDeviceRef *deviceRef,
CFragConnectionID *connID);
This function can be used to get the code fragment connection ID of a device driver or interface driver. An example of its use in a application would be to locate and display information about a device driver. You could use the USBGetDriverConnectionID function to get the connection ID, and then pass the connection ID to the FindSymbol function, defined in Inside Macintosh: Power PC System Software, Chapter 3, "Code Fragment Manager," to locate the address of the pTheUSBDriverDescription structure, which contains the USB driver description information.
Here's a code snippet showing the basic idea. This snippet does not include any error or system zone checking code, which the driver would have to supply.
USBGetDriverConnectionID(&theDeviceRef, &connID);
FindSymbol (connID, "\pTheUSBDriverDescription",
(Ptr *)&pTheUSBDriverDescription, &symClass);
sprinf((char *)buf, "Driver Description Version:. 0x%04x",
pTheUSBDriverDescription->usbDriverDescVersion);
Previous | Back Up One Level | Next | Show Frames | Hide Frames